package me.caofeng.enums;


/**
 * Copyright © 2017曹峰. All rights reserved.
 *
 * @Prject: mall
 * @Package: me.caofeng.enums
 * @Description: 选中或非选中状态
 * @Author: 曹峰 blog.caofeng.me
 * @Date: 2017-06-26 14:25
 * @Version: V1.0
 */
public enum CheckStatus {
    CHECKED(1, true),
    UNCHECKED(0, false);

    private int id;
    private boolean status;

    CheckStatus() {
    }

    CheckStatus(int id, boolean status) {
        this.id = id;
        this.status = status;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public static CheckStatus getStatus(int id) {
        switch (id) {
            case 0:
                return UNCHECKED;
            case 1:
                return CHECKED;
            default:
                return UNCHECKED;
        }
    }
}
